
#include "CTestPointOperations.h"
#include <limits>


CPPUNIT_TEST_SUITE_REGISTRATION(CTestPointOperations);


void CTestPointOperations::setUp(void)
{
    testObj = new CPointOperations();
}


void CTestPointOperations::tearDown(void)
{
    delete testObj;
}


void CTestPointOperations::testMultiply(void)
{
    CPPUNIT_ASSERT_EQUAL(100, testObj->multiply(10, 10));
    CPPUNIT_ASSERT_EQUAL(-100, testObj->multiply(-5, 20));
    CPPUNIT_ASSERT_EQUAL(-56, testObj->multiply(8, -7));
    CPPUNIT_ASSERT_EQUAL(0, testObj->multiply(8, 0));
}


void CTestPointOperations::testDivide(void)
{
    CPPUNIT_ASSERT_EQUAL(10, testObj->divide(100, 10));
    CPPUNIT_ASSERT_EQUAL(-6, testObj->divide(-30, 5));
    CPPUNIT_ASSERT_EQUAL(-30, testObj->divide(90, -3));
    CPPUNIT_ASSERT_EQUAL_MESSAGE("Divison durch 0", numeric_limits<int>::max(), testObj->divide(90, 0));
}
